Procedures and functions (stored routines) are supported in MySQL 5.0. A stored routine is a set of SQL statements that can be stored in the server. In the main window, click
Function to open the function object list.
Function Designer is the basic Navicat tool for working with procedures/functions. You can enter a valid SQL statement in the Definition tab. This can be a simple statement such as SELECT or INSERT, or it can be a compound statement written using BEGIN and END. Compound statements can contain declarations, loops, and other control structure statements. To customize the view of the editor and find out more features for SQL editing, see SQL Editor for details.
To execute the procedure/function, click
on the toolbar. If the SQL statement is correct, the statement will be executed and, if the statement is supposed to return data, the Result tab opens with the data returned. If an error occurs while executing the procedure/function, execution stops, the appropriate error message is displayed. If the procedure/function requires input parameters, the Input Parameters dialog will pop up. Check the Raw Mode option to pass the inputted values to the procedure/function without quotation marks.
Note: Navicat supports to return 10 result sets.